$(document).ready(function()
    {
        $.notif_data_user = function(data)
        {
            $("#SW").html(data.data.personal.IURAN_WAJIB);
            $("#SP").html(data.data.personal.IURAN_POKOK);

            $("#LIST_PINJAMAN").html("");
            var total_piutang = 0, total_potongan = 0;
            for(var i = 0; i < data.data.rencana_potongan.length; i++)
                {
                    var current = data.data.rencana_potongan[i];
                    total_piutang += current.PIUTANG * 1;
                    total_potongan += current.POTONGAN * 1;
                    var persen = 100 - Math.round(current.PIUTANG * 100 / current.JUMLAH_PINJAMAN);
                    $("#LIST_PINJAMAN").append('<tr>\n\
                                <td style="width: 30%">'+current.URAIAN_USAHA+'</td><td style="width: 60%"><div class="progress progress-red"><span style="width: '+persen+'%"><b>'+persen+'%</b></span></div></td>\n\
                            </tr>')
                }
            $("#TOTAL_PIUTANG").html(Math.round(total_piutang));
            $("#TOTAL_POTONGAN").html(Math.round(total_potongan));
        }

        $.data_ajax('br-02/member/get_personality', null, $.notif_data_user);
    });